import { IMessageBase } from "../../Framework/MQ/IMessageBase";
import { MessageManager } from "../../Framework/MQ/MessageManager";
import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { SeqRewardHelper } from "./SeqRewardHelper";
import { SEntityId } from "./SEntityId";
type int = number;
//class SGroupBuyRewards
    
    export  class SGroupBuyRewards extends IMessageBase
    {
        constructor(arg1: Boolean=false)
        {
            
            super();if (arg1) 
            {
                MessageManager.instance().regist(this);
            }
            return;
        }

        public /* override */ getType(): int
        {
            return this._type;
        }

        public /* override */ clone(): IMessageBase
        {
            return new SGroupBuyRewards();
        }

        public /* override */ __write(arg1: SerializeStream): void
        {
            this.sEntiyId.__write(arg1);
            arg1.writeInt(this.rank);
            arg1.writeBool(this.success);
            SeqRewardHelper.write(arg1, this.rewards);
            arg1.writeInt(this.itemCode);
            arg1.writeInt(this.unit);
            arg1.writeInt(this.buyPrice);
            arg1.writeInt(this.endPrice);
            arg1.writeInt(this.playerNum);
            return;
        }

        public /* override */ __read(arg1: SerializeStream): void
        {
            this.sEntiyId = new SEntityId();
            this.sEntiyId.__read(arg1);
            this.rank = arg1.readInt();
            this.success = arg1.readBool();
            this.rewards = SeqRewardHelper.read(arg1);
            this.itemCode = arg1.readInt();
            this.unit = arg1.readInt();
            this.buyPrice = arg1.readInt();
            this.endPrice = arg1.readInt();
            this.playerNum = arg1.readInt();
            return;
        }

        public /* const */_type: int=728;

        public /* var */sEntiyId: SEntityId;

        public /* var */rank: int;

        public /* var */success: Boolean;

        public /* var */rewards: Array<any>;

        public /* var */itemCode: int;

        public /* var */unit: int;

        public /* var */buyPrice: int;

        public /* var */endPrice: int;

        public /* var */playerNum: int;

        public static /* var */_regist: SGroupBuyRewards;
    }

            SGroupBuyRewards._regist = new SGroupBuyRewards(true);
        